<ul class="pagination pagination-sm no-margin pull-right">
	<li><a class="first">首页</a></li>
	<li><a class="pre">上一页</a></li>
	<li><a class="next">下一页</a></li>
	<li><a class="last">尾页</a></li>
	<li><a class="rowCount">总记录数(0)</a></li>
	<li><a class="pageCount">总页数(0)</a></li>
	<li><a class="pageCurrent">当前页(1)</a></li>
</ul>
<script type="text/javascript">
   $(".pagination")
   .on("click",".first,.pre,.next,.last",doJumpToPage)
   //设置分页
   function setPagination(data){
	   //1.初始化总页数
	   $(".pageCount").html("总页数("+data.pageCount+")");
	   //2.初始化总记录数
	   $(".rowCount").html("总记录数("+data.rowCount+")");
	   //3.初始化当前页页码
	   $(".pageCurrent").html("当前页("+data.pageCurrent+")");
	   //4.绑定数据
	   $(".pagination").data("pageCurrent",data.pageCurrent);
	   $(".pagination").data("pageCount",data.pageCount);
   }
   function doJumpToPage(){
	   //1.获取当前页码以及总页数
	   var pageCurrent=
	   $(".pagination").data("pageCurrent");
	   var pageCount=
	   $(".pagination").data("pageCount");
	   //2.根据当前点击的对象执行pageCurrent加减操作
	   var cls=$(this).prop("class");
	   if(cls=="pre"&&pageCurrent>1){
		   pageCurrent--;
	   }else if(cls=="next"&&pageCurrent<pageCount){
		   pageCurrent++;
	   }else if(cls=="first"){
		   pageCurrent=1;
	   }else if(cls=="last"){
		   pageCurrent=pageCount;
	   }
	   //3.保存当前pageCurrent的值
	   $(".pagination").data("pageCurrent",pageCurrent);
	   //4.按指定页码重新执行查询
	   doGetObjects();
   }
</script>


